# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Jan-Erik Rediger <badboy at archlinux dot us>

pkgname=bash-bats-assert
pkgver=0.3.0
pkgrel=3
pkgdesc="Common assertions for Bats"
arch=("any")
url="https://github.com/ztombol/bats-assert"
license=("custom:CC0")
depends=('bash-bats-support')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ztombol/bats-assert/archive/v$pkgver.tar.gz")
sha512sums=('a1eba4e07bf03945e5427a8f3e89d6bde2cc7c2229229d0d8d7baf0ef6cd5bfa8e24a565fce5b2fd0bb8cb87f9eee70f7fc6c2ee42d1706a13c55c3af9467400')

check() {
  cd bats-assert-$pkgver
  TEST_DEPS_DIR=/usr/lib bats test
}

package() {
  cd bats-assert-$pkgver

  for fn in *.bash; do
    install -Dm755 $fn \
      "$pkgdir"/usr/lib/bats-assert/$(basename $fn)
  done

  for fn in src/*.bash; do
    install -Dm755 $fn \
      "$pkgdir"/usr/lib/bats-assert/src/$(basename $fn)
  done

  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
